package cn.com.thinker.core.dao.jpa.support;

import java.io.Serializable;

import javax.persistence.EntityManager;

import cn.com.thinker.core.dao.jpa.specs.LikeSpecs;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;


public class ThinkerRepositoryImpl<T, ID extends Serializable>
					extends SimpleJpaRepository<T, ID>  implements ThinkerRepository<T,ID> {

	private final EntityManager entityManager;

	public ThinkerRepositoryImpl(Class<T> domainClass, EntityManager entityManager) {
		super(domainClass, entityManager);
		this.entityManager = entityManager;
	}

	@Override
	public Page<T> findByAuto(T example, Pageable pageable) {
		return findAll(LikeSpecs.byAuto(entityManager, example),pageable);
	}

	// 扩展其他方法

}
